home *** CD-ROM | disk | FTP | other *** search
- Tutorial
- ========
-
- This document is intended to acquaint the new user as painlessly as possible
- with the most commonly-used facilities of Powerbase. It does not explain how
- to create a database from scratch (the file 'Create' does that) but it does
- explain how to:-
-
- (a) Start up Powerbase and open an existing database.
- (b) Browse through the database and search for individual records.
- (d) Add new records and alter or delete existing ones.
- (d) Query the database to create simple reports.
- (e) Close the database.
-
- The supplied sample database 'Elements' is used to illustrate most of these
- activities. If you have a hard disc you should copy 'Elements' and Powerbase
- itself onto it before proceeding further. It is possible to use Powerbase
- using floppy discs only but some operations, such as creating reports, will
- be quite slow. Unless memory is very tight therefore, users of floppy discs
- are recommended to allocate at least 112K to the RAM disc and copy
- 'Elements' onto it. Everything will then run much faster. Powerbase can
- provide context-sensitive help via Acorn's !Help application and you are
- advised to load this, resizing the help window and placing it at the top
- right of the screen. Further help can be had by choosing the Help entry on
- Powerbase's main menu or on the icon-bar menu.
-
- Starting Powerbase
- ==================
- Double-click on the Powerbase icon. After a few seconds it will appear on
- the icon-bar with the words "No data" beneath it to show that no database is
- open. Dragging the 'Elements' icon onto the Powerbase icon on the icon-bar
- will open 'Elements' for use and the words "No data" will be replaced by the
- name of the database. Double-clicking on the 'Elements' icon has the same
- effect, in fact if Powerbase isn't already on the icon-bar a double-click on
- 'Elements' will install it for you provided that the Powerbase icon has been
- seen by the filer.
-
- Two windows will open. One is the RECORD WINDOW and displays the first
- record in the database. The other is the KEYPAD which allows you to control
- the browsing, searching and editing functions of Powerbase. The keypad is
- rather large and obscures quite a big area of the record window. The
- most-used buttons, however, are on the top two rows and the keypad can be
- moved part way off screen to get it out of the way.
-
- Browsing through the Records
- ============================
- The top row of buttons on the keypad allows you to browse through the file.
- If you have !Help running, as previously suggested, it will tell you what
- each button does. Once you get the general idea you will find the symbols on
- the buttons logical and self-explanatory. The most commonly used ones act as
- follows:
-
- * Single arrows move you one record at a time. From ACTINIUM, clicking the
- right arrow takes you to ALUMINIUM. The left arrow takes you back to
- ACTINIUM.
-
- * Double arrows move you through the file by long hops. Thus the right
- double arrow takes you from ACTINIUM to BISMUTH and the left one back to
- ACTINIUM again. The "fast forward/rewind" value is shown in the little
- box between the "fast wind" buttons. It is initially set to 10 records
- but can be altered by clicking in it with SELECT and entering a new
- value.
-
- * The buttons at the far left and right take you to the beginning and end of
- the file. The rightmost button therefore takes you to ZIRCONIUM and the
- leftmost one to ACTINIUM.
-
- One further feature of these buttons should be noted; the file wraps around.
- If you are at the last record (ZIRCONIUM) one record "forward" takes you to
- ACTINIUM again. Similarly, one record "back" from ACTINIUM gives ZIRCONIUM.
-
- The second row has buttons marked like the 'play' and 'stop' controls of a
- cassette player. 'Play' allows an automatic 'flip-through' of the records
- without the need to touch any other buttons. When you get to the place you
- want, click on 'stop'. If the records go past too quickly you can slow the
- process down by increasing the number in the central icon of the top row of
- buttons. (This is normally used to set the 'fast-wind' interval; see above.)
-
- Key fields, Keys and Indices
- ============================
- When using the six buttons on the top row of the keypad you will have
- noticed that the records appear to be arranged alphabetically by the name of
- the element. The actual order in which records occur in the file is in fact
- nothing like alphabetical, but the order in which they are ACCESSED is
- determined by an INDEX which forces them to appear in alphabetical order.
- Every database must have at least one index, but you can have as many extra
- ones as you wish (subject to memory and disc limitations).
-
- Changing index
- --------------
- The second row of the keypad has two buttons featuring a blue arrow with a
- key symbol. Click on the right one and the record for HYDROGEN is displayed!
- If you now experiment with the top row of buttons as before you will find
- that the records no longer appear in alphabetical order of name but in order
- of ATOMIC NUMBER instead. What we have done is change to a different index.
- If a database has multiple indices the "key" buttons allow you to cycle
- through them in opposite directions. (Since Elements has only two indices
- the two buttons have exactly the same effect.) When you change to a
- different index the screen always displays the first record as determined by
- that index.
-
- Keys and key fields
- -------------------
- An index is built from KEYS which are derived from a particular KEY FIELD.
- The two indices used by Elements are based on the NAME and ATOMIC NUMBER
- fields. The way in which the key stored in the index is derived from the key
- field is different in the two cases. For the NAME index the first four
- letters of the name are used. Since no two elements have names beginning
- with the same four letters this gives a unique "value" for the key. (Two
- letters would not have been enough because of such names as CHLORINE and
- CHROMIUM.) The ATOMIC NUMBER index is based on the whole 3-digit maximum
- length and the ordering is NUMERIC. Whenever a record is displayed the key
- is shown in the window title (# characters are for padding and should be
- ignored.)
-
- The record screen clearly shows which fields are keyfields and which are
- not. The descriptors, or labels, of fields are normally black. Where the
- fields are keyfields they are shown in dark blue instead and the field used
- by the current index has its descriptor in red. Note also that the
- background colour of the NAME field is pale yellow whereas the rest are
- white . This indicates that NAME is the PRIMARY KEY field. The primary key
- and the index based on it is more important than the others. It is the one
- index which a database MUST have and is the one selected when a database is
- first opened.
-
- Searching for a record
- ======================
- The rightmost button on the third row of the keypad shows a question mark
- followed by a "record card" icon We will call it the Search button.
- When clicked with SELECT the keypad window grows an extension on the
- right-hand side. This new area contains a writable icon in which to enter
- the key of the record you wish to display. Suppose you want to see the
- record for the element NITROGEN. If the current index is the NAME then type
- in NITR and either type RETURN or click the 'OK' button. The required record
- quickly appears. If you enter the key of a non-existent record an error box
- is displayed. You don't necessarily need to type the whole key; NIT would do
- in this case, but NI would be ambiguous (there are elements called NICKEL
- and NIOBIUM).
-
- To find NITROGEN when the ATOMIC NUMBER index is active you would need to
- know that the atomic number of nitrogen is 7. Type this in and type RETURN
- or click on 'OK' and the record appears. Abbreviated keys are NOT allowed in
- this case for obvious reasons; if you want element 103 (LAWRENCIUM) it's no
- good entering 10 (NEON)!
-
- Editing the Database
- ====================
- This part of the tutorial involves changes to the data records. Make a
- working copy of the disc and put the original in a safe place. If you are
- using a copy of Elements on the RAM disc then the floppy disc won't be
- altered, but it's still not a good idea to work with the original disc.
-
- Modifying records
- -----------------
- Pointing the mouse at any field and clicking SELECT places the caret in that
- field. The contents of the field may then be edited in the standard way for
- RISC OS writable icons. i.e.
-
- CTRL U clears the field.
- DELETE removes the character to the left of the caret.
- COPY removes the character to the right of the caret.
- SHIFT/COPY deletes the word to the right of the caret.
- CTRL/COPY deletes everything from the caret to the end of the line.
- ⇦ and ⇨ move the caret left/right by one character.
- SHIFT ⇦ and SHIFT ⇨ move the caret left/right by one word.
- CRTL ⇦ and CTRL ⇨ move the caret to start and end of the field.
-
- Changes made to a record cause the record to be written back to the database
- whenever you display a different record or close the database. There is a
- button on the keypad called 'Force update' but you don't normally need to
- use it.
-
- At the ends of the third row of keypad buttons are two which contain a
- vertical blue arrow. Clicking on the left button stores the contents of the
- field which has the caret in a scratchpad. Moving the caret to another
- field and clicking the right button copies the data from the scratchpad
- into that field, over-writing its previous contents. This provides a quick
- method of copying data from one field to another, or from one record to
- another. You may continue to "paste" the data into new fields as often as
- you like. Only when you click the left button again are the contents of the
- scratchpad changed. Data "pasted" into a field cannot "overflow"; if too
- long for the field it will be cut to the permitted length. As an added
- precaution you can't "paste" a null string into a field.
-
- Recovering data after a mistake
- -------------------------------
- You will sometimes edit the wrong field by mistake and want to restore the
- previous contents. Click MENU over the field. The second entry on the main
- menu contains the "tag" of the field. Follow the right-pointing arrow to the
- 'Field' sub-menu and choose the last entry: 'Restore field'. Similarly, if
- you make a mess of a complete record and want to go back to the way it was
- you can choose 'Restore record' from the main menu.
-
- It is important to realise that these 'restore' facilities will not work if
- you have looked at another record before using them (or clicked on 'Force
- update'). In other words you can recover data which has been altered in or
- removed from the currently-displayed record only.
-
- Adding new records
- ------------------
- First we will add a new record for a fictitious element as described below:-
-
- NAME TASMANIUM
- SYMBOL Ts
- ATOMIC NUMBER 108
-
- We could invent a lot more, but this will be enough to get the idea across.
-
- At the far left of the second row on the keypad is a button with a plus sign
- and a "record card" icon. This is the 'Insert' button. A blank record will
- be displayed with the caret in the NAME field. Enter TASMANIUM here and
- press RETURN. The caret will jump to the SYMBOL field. Enter Ts. You will
- now need to press RETURN twice to get to ATOMIC NUMBER (One press takes you
- to the un-named field after NAME where the origin of the element's name is
- given.) Alternatively you could point the mouse at the ATOMIC NUMBER box and
- click SELECT. There is no need to press RETURN after entering a field in
- order to "accept" the data; it's simply the most convenient way of getting
- to the next field if that's what you want to do. When entering data into
- widely- scattered fields it is more convenient to use the mouse.
-
- Having entered your data click any of the first row of buttons so that a
- different record is displayed. Now use 'Search' to find TASMANIUM by name.
- Change to the other index and find it by atomic number. In both cases try
- moving to the record just before and just after the new one, noting that it
- has been placed in its correct position in both indices: between TANTALUM
- and TECHNETIUM in the NAME index and at the very end of the ATOMIC NUMBER
- index.
-
- Data Input Validation
- ---------------------
- When entering the above data you may have noticed that the NAME field will
- only accept capital letters and the ATOMIC NUMBER field will only accept
- numerals. This is because the fields have an associated TYPE which restricts
- the characters which the field will accept. Any others are simply ignored.
- We will call this feature TYPE VALIDATION.
-
- Another level of data validation, which we will now illustrate, is called
- TABLE VALIDATION Make an entry in the GROUP field. Type X, for example,
- then try to move to another field by either pressing RETURN or clicking the
- mouse. You'll find that you can't do so - you get an error message instead.
- This is because the GROUP field is linked to a VALIDATION TABLE which
- means that only entries which appear in the table may be used in that field.
- Fields linked to validation tables are distinguished by using dark green,
- instead of black, as the foreground colour.
-
- To see what the validation table contains, place the caret in the GROUP
- field then click on the List values button on the keypad. The validation
- table will then be displayed in its own window. Only those items in the left
- column of the table may be entered in the GROUP field. Element 108 would be
- a transition metal, so enter T. You will now find that Powerbase accepts
- your data.
-
- Both type validation and table validation may be turned off and on by means
- of an option on the Validation submenu. The item is normally ticked, showing
- that validation is turned on.
-
- Deleting records
- ----------------
- Since "tasmanium" isn't a real element we want to remove it from our
- database. There is a "dustbin" button which will do just that: but don't
- use it yet. Make sure that the unwanted record is on the screen and click
- the button to the RIGHT of the bin. You will now find that "tasmanium" has
- vanished; the names run straight from TANTALUM to TECHNETIUM and the atomic
- numbers end with 103, just as they did before you added the extra record.
-
- Wasn't that rather TOO easy? Suppose you clicked the button by mistake and
- deleted an important record! Powerbase handles this very nicely. The record
- hasn't really been deleted at all. To prove this, click the button above the
- one you used for "deleting". The button shows a green right-pointing arrow
- and a "card index" icon. There's TASMANIUM again! You will soon find that it
- appears to be the ONLY record in the file! Don't worry; nothing has been
- lost. A Powerbase database is treated as six separate SUBFILES
- numbered 0-5. When you first open the database you are looking at Subfile 0
- and the heading of the record window shows this. If you look at the heading
- now you will see that it has changed to Subfile 1.
-
- The buttons on either side of the bin carry pictures which suggest their
- true functions. They do NOT delete records; they merely MOVE records from
- one subfile to another. The right button moves the displayed record to the
- next subfile in sequence. Thus, in the above case the TASMANIUM record has
- been moved from subfile 0 to subfile 1. A record in subfile 1 would be moved
- to subfile 2 and so on. What happens when it gets to 5? The next click
- shoves it into subfile 0 where it was originally. As you might have guessed,
- the left button moves records in the opposite direction, i.e. from subfile 1
- to 0 or from subfile 0 to 5.
-
- What happens when you DO want to lose a record for good? That's when you
- consign it to the dustbin! Since this button's action is more drastic than
- that of the other two you are asked for confirmation before deletion occurs.
-
- Printing Lists
- ==============
- Before Powerbase can produce a list it must be told:
-
- * which FIELDS should appear on the list
- * which RECORDS should appear on the list.
-
- Making the field selection
- --------------------------
- Specifying the fields you want is extremely easy. To include a field simply
- point the mouse at it and click with ADJUST. The selected field will then
- appear in inverse video (i.e. normally white on black). If you change your
- mind about a field you can de-select it by clicking on it again with ADJUST.
- The order in which the fields will appear in the printed list is the order
- in which you select them. Take care with this since there is nothing on the
- screen to indicate what order the fields will be in. The fields chosen for
- inclusion in a printout make up a SELECTION which may be saved and reloaded
- for future use. Just for now select NAME, SYMBOL and GROUP.
-
- Choosing which records to print
- -------------------------------
- Specifying which records to print is somewhat more complex, although efforts
- have been made to render it as simple as possible. With the mouse pointer in
- the record window click MENU. This displays the main Powerbase menu from
- which you should choose Print. A small window appears in which you can
- specify the criteria which must be met by records for inclusion in the list.
- If you just click OK (or press RETURN) without entering anything here you
- will obtain a list of the whole database (or, more accurately, of the the
- whole of the current subfile ). Try this first.
-
- Nothing will be printed until the search is complete. If the mouse pointer
- is over the main window the hourglass will tell you how far things have
- progressed. Pressing Escape causes the process to be aborted. When the
- process is complete the list will be displayed in a window. It may be saved
- as a text file and printed using the usual RISC OS drivers .
-
- If you point to a record in the displayed list and double-click with SELECT
- Powerbase will display the chosen record in the main record window. Note
- that the caret is placed in the field you were pointing to on the list. This
- is very useful if you spot errors in the data whilst examining a list. A
- double click on the offending item offers the record with the caret
- correctly positioned for editing.
-
- Most database queries, however, don't involve printing all the records! You
- will usually need to enter a SEARCH FORMULA before clicking OK. Search
- formulae can be quite complex and a more detailed treatment is given in a
- later section. Only a couple of simple examples will be shown here.
- Suppose we want a list of all the transitional elements. i.e. all those
- which have T in the GROUP field. We can do this by entering the search
- formula GP=T. Why GP? Shouldn't it be GROUP=T? The latter seems more
- obvious, but what happens if the field has no descriptor? The record screen
- of !Elements contains many such fields such as the one on the first line
- which gives the origin of the element's name. Every field which can hold
- data has to have a "handle" by which we can refer to it and that handle is
- called the field TAG. Tags are very short; never more than four characters.
- You have seen some tags already. Look at the list you printed earlier. The
- three columns are headed NAME, SYM and GP not NAME, SYMBOL and GROUP. The
- user therefore meets tags in two contexts:
-
- * They are used to specify fields in search formulae
- * They are the default column headings in lists.
-
- The Print options window allows you to change the column headings to the
- field descriptors if you so wish.
-
- Type GP=T in the space provided and click OK. This time the list will be a
- much shorter one and you will see that the GP column contains T in every
- case.
-
- Our second example involves printing all elements whose names end in "IUM".
- What we need to specify is that "NAME contains IUM" and we do this by
- entering the search formula NAME{IUM. Finally we will combine the previous
- two examples into a two-pronged search for all the TRANSITIONAL elements
- whose names end in "IUM". The search formula this time is NAME{IUM AND GP=T.
- Note the spaces before and after AND. These are essential. You might like
- to try an alternative way of entering this search formula. Proceed as
- follows:
-
- * Click the "toggle size" icon of the matching records window. This
- makes it expand to show more controls.
- * NAME should already be visible as the required field, but you need
- to select the radio button for Contains.
- * Click in the space next to Value: and enter IUM.
- * Click the AND button to select it.
- * Click Add to formula.
-
- The search formula should now read NAME{IUM AND.
-
- * Click on the field tag (currently NAME) until it reads GP
- * Select Is equal to.
- * Enter T in the Value field.
- * Click Add to formula.
-
- The complete search formula should now be visible so click OK and the list
- will be produced. The above takes far longer to describe than it does to do
- and can be a great help to the infrequent Powerbase user who has trouble
- remembering the syntax of search formulae. If you use certain complex
- queries often you may find it convenient to save them for future use .
-
- The biggest problem you are likely to encounter is not knowing the tags for
- the various fields. The method just described gets round the problem by
- letting you cycle through the tags by clicking on an icon rather than typing
- them directly. You will also find that clicking with SELECT on a field while
- holding down ALT causes the tag of that field to appear in the search
- formula icon.
-
- Closing down
- ============
- A database may be closed down by choosing the Close database entry from the
- icon bar menu. When you do so, all the indices stored in memory are saved
- to disc (the Save indices button on the keypad gives a clear indication of
- this) and the database is closed. You do not have to do anything to save the
- database itself to disc since it has been there all along. Only the current
- record is in memory at any one time and this is automatically written back
- to disc when it has been changed in any way.
-
- Also saved automatically is the link file which holds the relational links
- between the main database and the validation tables. The tables themselves
- are NOT saved automatically. If you have edited a table, or created a new
- one, you will need to click MENU over the displayed table and choose the
- Save option from it.
-
- If you are going to use another database straight away just double click on
- it or drag it to the Powerbase icon on the icon bar. In fact you don't even
- need to close the previous database before doing this; Powerbase will do it
- for you.
-
- When working with a database on the RAM disc Powerbase will issue a warning
- that the data is not secure and that you need to drag it from the RAM disc
- to a floppy or hard disc before switching off.
-
- To terminate Powerbase itself use the Quit option on the icon bar menu.
-
- Merging data into an Impression document
- ========================================
- The distribution disc contains a simple Impression document called
- 'MergeTest'. It will be used in conjunction with the 'Elements' database to
- illustrate direct data-merging with Impression.
-
- (1) Make sure that Impression has been "seen" by the filer. (You need not
- actually load it.)
-
- (2) Open the 'Elements' database and drop 'MergeTest' onto the record
- window.
-
- (3) Click on 'Merge' in the 'Merge data' dialogue box. You will see that
- data relating to the record for ACTINIUM has been inserted into the
- Impression document.
-
- (4) The arrow and double-arrow buttons (identical to those on the keypad)
- may be used to move through the database causing different records to be
- merged into the document.
-
- (5) A search formula may be used to restrict the operation to records
- matching certain criteria.
-
- (6) 'Print' may be used to print the document with the currently-merged
- data. To print a set of documents, one for each matching element,
- select the 'Print all' switch then click on 'Merge'.
-
- During data-merging Impression editing is disabled - you can't place the
- caret in the document and the mouse pointer appears as a red and blue cross.
- Clicking on 'Cancel' or closing the 'Merge data' dialogue box restores
- normal editing.
-
- For more information on data-merging, including instructions on how to
- prepare the Impression document, see 'MailMerge'.
-
-
-